<?php

/**
 * Personne form base class.
 *
 * @package    TC5
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BasePersonneForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'nom'           => new sfWidgetFormInput(),
      'prenom'        => new sfWidgetFormInput(),
      'pseudo'        => new sfWidgetFormInput(),
      'email'         => new sfWidgetFormInput(),
      'password'      => new sfWidgetFormInput(),
      'date_creation' => new sfWidgetFormDate(),
      'is_admin'      => new sfWidgetFormInputCheckbox(),
      'adresse'       => new sfWidgetFormTextarea(),
      'code_postal'   => new sfWidgetFormInput(),
      'ville'         => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorPropelChoice(array('model' => 'Personne', 'column' => 'id', 'required' => false)),
      'nom'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'prenom'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'pseudo'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'email'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'password'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'date_creation' => new sfValidatorDate(array('required' => false)),
      'is_admin'      => new sfValidatorBoolean(array('required' => false)),
      'adresse'       => new sfValidatorString(array('required' => false)),
      'code_postal'   => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'ville'         => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('personne[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Personne';
  }


}
